<?php

/**
 *
 * @author     村长+ <178277164@qq.com>
 */

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('polling_site_orders')) {
            Schema::create('polling_site_orders', function (Blueprint $table) {
                $table->comment('支付站点与订单号绑定');
                $table->id()->comment('ID');
                $table->string('payment_code')->comment('支付插件码');
                $table->string('order_no')->comment('订单号');
                $table->string('domain')->comment('支付的站点');
                $table->timestamps();
            });
        }
        if (!Schema::hasTable('polling_site_index')) {
            Schema::create('polling_site_index', function (Blueprint $table) {
                $table->comment('轮询支付站点的编号');
                $table->id()->comment('ID');
                $table->string('payment_code')->comment('支付插件码');
                $table->string('domain')->comment('支付域名');
                $table->bigInteger('now_index')->default(0)->comment('当前使用到的编号');
                $table->timestamps();
            });
        }


    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {

    }
};
